<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <script src="./javascripts/jquery.js"></script>
    <style>
        #frmLogin{
            margin: 20px auto;
            width: 400px;
            border: 1px solid gray;
            box-shadow: 5px 5px 8px black;
            border-radius: 8px;
            text-align: center;
            padding: 0;
        }
        #frmLogin > p.title{
            font-size: 24px;
            font-weight: bolder;
            line-height: 30px;
            padding: 10px;
            margin-top: 0;
            background-color: lightblue;
            border-bottom: 1px solid gray;
            border-radius: 8px 8px 0 0;
        }
        #frmLogin > p > label:first-child{
            display: inline-block;
            width: 100px;
            text-align: right;
        }
    </style>
</head>
<body>
    <div id="frmLogin">
        <p class="title">登&nbsp;&nbsp;&nbsp;&nbsp;录</p>
        <p>&nbsp;</p>
        <p>
            <label for="username">用户名：</label>
            <input type="text" name="username" id="username">
        </p>
        <p>
            <label for="password">密码：</label>
            <input type="password" name="password" id="password">
        </p>
        <p>&nbsp;</p>
        <p>
            <input type="button" name="submit" id="submit" value="登录">
        </p>
        <p>&nbsp;</p>
    </div>
    
</body>
<script>
    $('#submit').click(function(){
        $.ajax({
            url:'http://localhost:3000/login',
            method: 'POST',
            data: {
                username: $('#username').val(),
                password: $('#password').val()
            }
        }).then((res)=>{
            console.log(res);
        });
    });
</script>
</html>